/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Pedidos.Pedido.Vista;

import Pedidos.Cliente.BEAN.ClienteBEAN;
import Pedidos.Pedido.Controlador.PedidoControlador;
import Pedidos.Producto.BEAN.ProductoBEAN;
import Pedidos.Producto.DAO.ProductoDAO;
import java.util.ArrayList;
import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import sape.Menu;
import sape.MenuControlador;

/**
 *
 * @author Diego
 */
public class Pedido extends javax.swing.JInternalFrame {
    
    /**
     * Creates new form Pedido
     */
    public ClienteBEAN cliente=null;
    public PedidoControlador controlador = null;
    public ComboBoxModel cbProductosModel=null;
    
    public Pedido(MenuControlador menuControlador) {
        
        this.controlador=new PedidoControlador(this,menuControlador);
        this.controlador.setListaProductos();
        initComponents();
        this.controlador.disable();
    }
    public Pedido(MenuControlador menuControlador,int id) {
         
        this.controlador=new PedidoControlador(this,menuControlador,id);
        this.controlador.setListaProductos();
        initComponents();
        this.controlador.enable();
        this.controlador.setCliente();
    }


    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        pnlPrincipal = new javax.swing.JPanel();
        pnlInformacion1 = new javax.swing.JPanel();
        lbNombre1 = new javax.swing.JLabel();
        btnBuscarCliente = new javax.swing.JButton();
        lbNombre2 = new javax.swing.JLabel();
        lbNombre3 = new javax.swing.JLabel();
        lbNombre4 = new javax.swing.JLabel();
        lbNombreCliente = new javax.swing.JLabel();
        lbMailCliente = new javax.swing.JLabel();
        lbTelefonoCliente = new javax.swing.JLabel();
        pnlInformacion = new javax.swing.JPanel();
        lbNombre = new javax.swing.JLabel();
        lbPrecio = new javax.swing.JLabel();
        cmbProducto = new javax.swing.JComboBox();
        btnAgregarLista = new javax.swing.JButton();
        tbCantidad = new javax.swing.JTextField();
        scrScrollResultado = new javax.swing.JScrollPane();
        tblListaProductos = new javax.swing.JTable();
        jLabel1 = new javax.swing.JLabel();
        lblTotal = new javax.swing.JLabel();
        pnlInformacion2 = new javax.swing.JPanel();
        lbNombre5 = new javax.swing.JLabel();
        btnAceptar = new javax.swing.JButton();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        tbLatitud = new javax.swing.JTextField();
        tbLongitud = new javax.swing.JTextField();

        setBorder(null);
        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Pedido");

        pnlInformacion1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Cliente", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI", 1, 13), new java.awt.Color(0, 51, 102))); // NOI18N
        pnlInformacion1.setForeground(new java.awt.Color(0, 51, 153));

        lbNombre1.setFont(new java.awt.Font("Ubuntu", 1, 12)); // NOI18N
        lbNombre1.setForeground(java.awt.Color.gray);

        btnBuscarCliente.setFont(new java.awt.Font("Segoe UI", 1, 13)); // NOI18N
        btnBuscarCliente.setForeground(new java.awt.Color(0, 51, 102));
        btnBuscarCliente.setText("Buscar");
        btnBuscarCliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBuscarClienteActionPerformed(evt);
            }
        });

        lbNombre2.setFont(new java.awt.Font("Segoe UI", 1, 13)); // NOI18N
        lbNombre2.setForeground(new java.awt.Color(0, 51, 102));
        lbNombre2.setText("Nombre:");

        lbNombre3.setFont(new java.awt.Font("Segoe UI", 1, 13)); // NOI18N
        lbNombre3.setForeground(new java.awt.Color(0, 51, 102));
        lbNombre3.setText("Email:");

        lbNombre4.setFont(new java.awt.Font("Segoe UI", 1, 13)); // NOI18N
        lbNombre4.setForeground(new java.awt.Color(0, 51, 102));
        lbNombre4.setText("Telefono:");

        javax.swing.GroupLayout pnlInformacion1Layout = new javax.swing.GroupLayout(pnlInformacion1);
        pnlInformacion1.setLayout(pnlInformacion1Layout);
        pnlInformacion1Layout.setHorizontalGroup(
            pnlInformacion1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlInformacion1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lbNombre1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlInformacion1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(pnlInformacion1Layout.createSequentialGroup()
                        .addComponent(lbNombre2)
                        .addGap(5, 5, 5))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlInformacion1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(lbNombre3)
                        .addComponent(lbNombre4)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(pnlInformacion1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlInformacion1Layout.createSequentialGroup()
                        .addComponent(lbMailCliente)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(btnBuscarCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(pnlInformacion1Layout.createSequentialGroup()
                        .addGroup(pnlInformacion1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lbNombreCliente)
                            .addComponent(lbTelefonoCliente))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        pnlInformacion1Layout.setVerticalGroup(
            pnlInformacion1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlInformacion1Layout.createSequentialGroup()
                .addGroup(pnlInformacion1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlInformacion1Layout.createSequentialGroup()
                        .addComponent(lbNombre1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lbNombreCliente)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(pnlInformacion1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lbMailCliente)
                            .addComponent(btnBuscarCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lbTelefonoCliente))
                    .addGroup(pnlInformacion1Layout.createSequentialGroup()
                        .addComponent(lbNombre2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lbNombre3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lbNombre4)))
                .addContainerGap(41, Short.MAX_VALUE))
        );

        pnlInformacion.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Detalle", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI", 1, 13), new java.awt.Color(0, 51, 102))); // NOI18N

        lbNombre.setFont(new java.awt.Font("Segoe UI", 1, 13)); // NOI18N
        lbNombre.setForeground(new java.awt.Color(0, 51, 102));
        lbNombre.setText("Producto");

        lbPrecio.setFont(new java.awt.Font("Segoe UI", 1, 13)); // NOI18N
        lbPrecio.setForeground(new java.awt.Color(0, 51, 102));
        lbPrecio.setText("Cantidad");

        cmbProducto.setFont(new java.awt.Font("Segoe UI", 0, 13)); // NOI18N
        cmbProducto.setForeground(new java.awt.Color(0, 51, 102));
        cmbProducto.setModel(cbProductosModel);

        btnAgregarLista.setFont(new java.awt.Font("Segoe UI", 1, 13)); // NOI18N
        btnAgregarLista.setForeground(new java.awt.Color(0, 51, 102));
        btnAgregarLista.setText("Agregar");
        btnAgregarLista.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAgregarListaActionPerformed(evt);
            }
        });

        tbCantidad.setFont(new java.awt.Font("Segoe UI", 0, 13)); // NOI18N
        tbCantidad.setForeground(new java.awt.Color(0, 51, 102));
        tbCantidad.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        tbCantidad.setText("5");
        tbCantidad.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tbCantidadActionPerformed(evt);
            }
        });

        tblListaProductos.setAutoCreateRowSorter(true);
        tblListaProductos.setFont(new java.awt.Font("Ubuntu", 0, 12)); // NOI18N
        tblListaProductos.setModel(controlador);
        tblListaProductos.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        tblListaProductos.setDropMode(javax.swing.DropMode.ON_OR_INSERT_ROWS);
        tblListaProductos.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tblListaProductosMouseClicked(evt);
            }
        });
        scrScrollResultado.setViewportView(tblListaProductos);

        jLabel1.setFont(new java.awt.Font("Segoe UI", 1, 13)); // NOI18N
        jLabel1.setForeground(new java.awt.Color(0, 51, 102));
        jLabel1.setText("TOTAL:");

        lblTotal.setFont(new java.awt.Font("Segoe UI", 1, 13)); // NOI18N
        lblTotal.setForeground(new java.awt.Color(0, 51, 102));
        lblTotal.setText("S/. 0.00");

        javax.swing.GroupLayout pnlInformacionLayout = new javax.swing.GroupLayout(pnlInformacion);
        pnlInformacion.setLayout(pnlInformacionLayout);
        pnlInformacionLayout.setHorizontalGroup(
            pnlInformacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlInformacionLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlInformacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlInformacionLayout.createSequentialGroup()
                        .addComponent(lbNombre)
                        .addGap(26, 26, 26)
                        .addComponent(cmbProducto, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(lbPrecio)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(tbCantidad, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(btnAgregarLista, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addComponent(scrScrollResultado, javax.swing.GroupLayout.Alignment.TRAILING))
                .addContainerGap())
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlInformacionLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jLabel1)
                .addGap(18, 18, 18)
                .addComponent(lblTotal)
                .addGap(34, 34, 34))
        );
        pnlInformacionLayout.setVerticalGroup(
            pnlInformacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlInformacionLayout.createSequentialGroup()
                .addGroup(pnlInformacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lbNombre)
                    .addComponent(cmbProducto, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lbPrecio)
                    .addComponent(tbCantidad, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnAgregarLista, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(12, 12, 12)
                .addComponent(scrScrollResultado, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 11, Short.MAX_VALUE)
                .addGroup(pnlInformacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(lblTotal))
                .addContainerGap())
        );

        pnlInformacion2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Destino", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI", 1, 13), new java.awt.Color(0, 51, 102))); // NOI18N

        lbNombre5.setFont(new java.awt.Font("Ubuntu", 1, 12)); // NOI18N
        lbNombre5.setForeground(java.awt.Color.gray);

        btnAceptar.setFont(new java.awt.Font("Segoe UI", 1, 13)); // NOI18N
        btnAceptar.setForeground(new java.awt.Color(0, 51, 102));
        btnAceptar.setText("Aceptar");
        btnAceptar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAceptarActionPerformed(evt);
            }
        });

        jLabel6.setFont(new java.awt.Font("Segoe UI", 0, 13)); // NOI18N
        jLabel6.setForeground(new java.awt.Color(0, 51, 102));
        jLabel6.setText("Latitud");

        jLabel7.setFont(new java.awt.Font("Segoe UI", 0, 13)); // NOI18N
        jLabel7.setForeground(new java.awt.Color(0, 51, 102));
        jLabel7.setText("Longitud");

        tbLatitud.setFont(new java.awt.Font("Segoe UI", 0, 13)); // NOI18N
        tbLatitud.setForeground(new java.awt.Color(0, 51, 102));
        tbLatitud.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        tbLatitud.setText("0");

        tbLongitud.setFont(new java.awt.Font("Segoe UI", 0, 13)); // NOI18N
        tbLongitud.setForeground(new java.awt.Color(0, 51, 102));
        tbLongitud.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        tbLongitud.setText("0");

        javax.swing.GroupLayout pnlInformacion2Layout = new javax.swing.GroupLayout(pnlInformacion2);
        pnlInformacion2.setLayout(pnlInformacion2Layout);
        pnlInformacion2Layout.setHorizontalGroup(
            pnlInformacion2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlInformacion2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlInformacion2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlInformacion2Layout.createSequentialGroup()
                        .addComponent(lbNombre5)
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlInformacion2Layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addGroup(pnlInformacion2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlInformacion2Layout.createSequentialGroup()
                                .addComponent(jLabel6)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(tbLatitud, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(66, 66, 66)
                                .addComponent(jLabel7)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(tbLongitud, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(175, 175, 175))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlInformacion2Layout.createSequentialGroup()
                                .addComponent(btnAceptar, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(247, 247, 247))))))
        );
        pnlInformacion2Layout.setVerticalGroup(
            pnlInformacion2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlInformacion2Layout.createSequentialGroup()
                .addComponent(lbNombre5)
                .addGap(36, 36, 36)
                .addGroup(pnlInformacion2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(tbLongitud, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6)
                    .addComponent(tbLatitud, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 25, Short.MAX_VALUE)
                .addComponent(btnAceptar, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        javax.swing.GroupLayout pnlPrincipalLayout = new javax.swing.GroupLayout(pnlPrincipal);
        pnlPrincipal.setLayout(pnlPrincipalLayout);
        pnlPrincipalLayout.setHorizontalGroup(
            pnlPrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlPrincipalLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlPrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(pnlInformacion1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(pnlInformacion, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(pnlInformacion2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        pnlPrincipalLayout.setVerticalGroup(
            pnlPrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlPrincipalLayout.createSequentialGroup()
                .addGap(18, 18, 18)
                .addComponent(pnlInformacion1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(pnlInformacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(pnlInformacion2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(pnlPrincipal, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(pnlPrincipal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnBuscarClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscarClienteActionPerformed
       controlador.buscarCliente();
    }//GEN-LAST:event_btnBuscarClienteActionPerformed

    private void tbCantidadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbCantidadActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_tbCantidadActionPerformed

    private void tblListaProductosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblListaProductosMouseClicked
        if(evt.getClickCount()==2){
            JTable target = (JTable)evt.getSource();
            int row = target.getSelectedRow(); 
            this.controlador.eliminarLista(row);

        }
    }//GEN-LAST:event_tblListaProductosMouseClicked

    private void btnAceptarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAceptarActionPerformed
       this.controlador.aceptar();
    }//GEN-LAST:event_btnAceptarActionPerformed

    private void btnAgregarListaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAgregarListaActionPerformed
        this.controlador.agregarLista(); 
        
         
    }//GEN-LAST:event_btnAgregarListaActionPerformed

  

    // Variables declaration - do not modify//GEN-BEGIN:variables
    public javax.swing.JButton btnAceptar;
    public javax.swing.JButton btnAgregarLista;
    private javax.swing.JButton btnBuscarCliente;
    public javax.swing.JComboBox cmbProducto;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    public javax.swing.JLabel lbMailCliente;
    private javax.swing.JLabel lbNombre;
    private javax.swing.JLabel lbNombre1;
    private javax.swing.JLabel lbNombre2;
    private javax.swing.JLabel lbNombre3;
    private javax.swing.JLabel lbNombre4;
    private javax.swing.JLabel lbNombre5;
    public javax.swing.JLabel lbNombreCliente;
    private javax.swing.JLabel lbPrecio;
    public javax.swing.JLabel lbTelefonoCliente;
    public javax.swing.JLabel lblTotal;
    private javax.swing.JPanel pnlInformacion;
    private javax.swing.JPanel pnlInformacion1;
    private javax.swing.JPanel pnlInformacion2;
    private javax.swing.JPanel pnlPrincipal;
    private javax.swing.JScrollPane scrScrollResultado;
    public javax.swing.JTextField tbCantidad;
    public javax.swing.JTextField tbLatitud;
    public javax.swing.JTextField tbLongitud;
    public javax.swing.JTable tblListaProductos;
    // End of variables declaration//GEN-END:variables
}
